#include "WiFiStatusComponent.h"

void WiFiStatusComponent::doRender()
{
	string path = NAVI_ICON_FILE(wifiStatusFile);
	lcd.drawBmpFile(SD, path.c_str(), WIFI_POS_X, WIFI_POS_Y);
}

void WiFiStatusComponent::setWiFiStatus(WiFiStatus status)
{
	switch (status)
	{
		case WIFI_NOT_CONNECT:
			this->wifiStatusFile = WIFI_0;
			break;
		case WIFI_SIGNAL_WEAK:
			this->wifiStatusFile = WIFI_1;
			break;
		case WIFI_SIGNAL_MEDIUM:
			this->wifiStatusFile = WIFI_2;
			break;
		case WIFI_SIGNAL_STRONG:
			this->wifiStatusFile = WIFI_3;
			break;
		default:
			break;
	}
}

WiFiStatusComponent::WiFiStatusComponent() : ViewComponent(false)
{
	this->setWiFiStatus(WIFI_SIGNAL_STRONG);
}


WiFiStatusComponent::~WiFiStatusComponent()
{
}
